package com.lottery.system.service.activitystatus.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author: xiaoxie
 * create: 2024-09-12 20:44
 * @BelongsProject: lottery-system
 * @BelongsPackage: com.lottery.system.service.activitystatus.enums
 * description: 责任链顺序枚举
 */
@AllArgsConstructor
@Getter
public enum SequenceEnum {
    BEFORE(1,"先执行"),
    AFTER(2,"后执行");

    private final Integer code;
    private final String msg;

    public static SequenceEnum forName(String msg) {
        for (SequenceEnum sequenceEnum : SequenceEnum.values()) {
            if (sequenceEnum.getMsg().equals(msg)) {
                return sequenceEnum;
            }
        }
        return null;
    }
}
